﻿<%@ Page Language="C#" MasterPageFile="~/Member/UserManage.master" EnableEventValidation="false"
    AutoEventWireup="true" CodeFile="Certificate.aspx.cs" Inherits="member_Certificate_Certificate"
    Title="证书管理" %>

<%@ Register Src="../../Control/PageNo.ascx" TagName="PageNo" TagPrefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContInfo" runat="server">

    <script type="text/ecmascript">
        function SelectAll()
        {
            // 找到所有的 input 元素
            var ctllist = document.getElementsByTagName("input");
            var objcheckbox= document.getElementById("CheckBox2");     
            for( var i = 0; i< ctllist.length; i++)
            {
                if(ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0 )
                {   
                    if(objcheckbox.checked==true)     
                         ctllist[i].checked = true;
                    else
                         ctllist[i].checked = false;
                }
          
             }
         }
    </script>

    <form id="form1">
        <div id="sub_content">
            <div class="pagetitle">
                证书管理</div>
            <div class="tishi">
                <span>提&nbsp;示：</span>·在管理证书时候请您慎重选择是否删除！
            </div>
            <div class="main_Supply_nav">
                <ul>
                    <li class="MenuLiCheck">证书管理</li>
                    <li class="search">
                    <table border="0" cellpadding="0" cellspacing="0" width="510">
                <tr>
                    <td>
                        公司名称：<asp:TextBox ID="txtCompany" runat="server"></asp:TextBox>&nbsp;证书名称：<asp:TextBox
                            ID="txtCertificateName" runat="server"></asp:TextBox>
                        <asp:Button ID="btnSearch" runat="server" OnClick="btnSearch_Click" Text="立即查询" CssClass="i_button" /></td>
                </tr>
            </table>
                    </li>
                </ul>
            </div>
            <asp:GridView ID="grdCertificate" runat="server" AutoGenerateColumns="False" CellPadding="0"
                GridLines="None" DataKeyNames="ID" Font-Bold="False" Font-Overline="False" AllowPaging="True"
                OnPageIndexChanging="grdCertificate_PageIndexChanging" Width="795" CssClass="table_main">
                <FooterStyle BackColor="#f1f1f1" Font-Bold="True" ForeColor="White" />
                <Columns>
                    <asp:TemplateField HeaderText="选项">
                        <ItemTemplate>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="权威证书">
                        <ItemTemplate>
                            <asp:Image ID="imgUrl" runat="server" ImageUrl='<%# Base.BasePage.ProcessAbsoluteUrl(Eval("URL").ToString()) %>' CssClass="table_photo" Width="80" Height="80" />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField DataField="CompanyName" HeaderText="公司名称"></asp:BoundField>
                    <asp:BoundField DataField="Name" HeaderText="证书名称"></asp:BoundField>
                    <asp:BoundField DataField="Organization" HeaderText="发证机构"></asp:BoundField>
                    <asp:TemplateField HeaderText="发证日期">
                        <ItemTemplate>
                            <%# GetShortDate(DataBinder.Eval(Container.DataItem, "LicenceDate").ToString()) %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="证书有效期">
                        <ItemTemplate>
                            <%# GetShortDate(DataBinder.Eval(Container.DataItem,"ExpiryDate").ToString()) %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="编辑">
                        <ItemTemplate>
                            <a href='CertificateEdit.aspx?ID=<%# DataBinder.Eval(Container.DataItem, "ID")%>&UserID=<%# Eval("UserID") %>'>
                                编辑</a>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
            <asp:Label ID="lblMessage" runat="server" Text="Label" Visible="False"></asp:Label>
            <div class="paging">
             <p><uc1:PageNo ID="PageNo1" runat="server" /></p>
                <input id="CheckBox2" name="CheckBox2" type="checkbox" onclick="SelectAll();" /> 全选 
                <asp:Button ID="btnDelete" runat="server" Text="批量删除" OnClick="btnDelete_Click" CssClass="i_button" />
                 
            </div>
        </div>
    </form>
</asp:Content>
